package com.ds.dsm.view.config.form.field;

import com.ds.esd.custom.annotation.ComboInputAnnotation;
import com.ds.esd.custom.annotation.ComboNumberAnnotation;
import com.ds.esd.custom.annotation.CustomAnnotation;
import com.ds.esd.custom.field.InputFieldBean;
import com.ds.esd.custom.form.annotation.FormAnnotation;
import com.ds.esd.dsm.view.field.FieldFormConfig;
import com.ds.esd.tool.ui.enums.*;

@FormAnnotation(col = 2)
public class FieldInputView {


    @CustomAnnotation(pid = true, hidden = true)
    String viewInstId;

    @CustomAnnotation(pid = true, hidden = true)
    String domainId;

    @CustomAnnotation(pid = true, hidden = true)
    String sourceMethodName;

    @CustomAnnotation(hidden = true, pid = true)
    public String entityClassName;

    @CustomAnnotation(hidden = true, pid = true)
    public String sourceClassName;

    @CustomAnnotation(hidden = true, pid = true)
    public String methodName;

    @CustomAnnotation(caption = "默认值")
    String value;
    @CustomAnnotation(caption = "格式化")
    String valueFormat;
    @ComboNumberAnnotation(increment = "1", precision = 0)
    @ComboInputAnnotation(inputType = ComboInputType.spin)
    @CustomAnnotation(caption = "最大长度")
    Integer maxlength;
    @CustomAnnotation(caption = "输入类型")
    InputType inputType;
    @CustomAnnotation(caption = "输入域位置")
    HAlignType hAlign;
    @CustomAnnotation(caption = "是否多行")
    Boolean multiLines;
    @ComboNumberAnnotation(increment = "1", precision = 0)
    @ComboInputAnnotation(inputType = ComboInputType.spin)
    @CustomAnnotation(caption = "缩放倍率")
    Integer autoexpand;
    @CustomAnnotation(caption = "是否可选中")
    Boolean selectable;
    @CustomAnnotation(caption = "标签定位")
    LabelPos labelPos;
    @CustomAnnotation(caption = "标签间隔")
    String labelGap;
    @CustomAnnotation(caption = "上下居中")
    HAlignType labelHAlign;
    @CustomAnnotation(caption = "左右居中")
    VAlignType labelVAlign;
    @CustomAnnotation(caption = "错误提示")
    String tipsErr;
    @CustomAnnotation(caption = "成功提示")
    String tipsOK;
    @CustomAnnotation(caption = "提示绑定")
    String tipsBinder;
    @CustomAnnotation(caption = "提示语")
    String mask;


    public FieldInputView() {

    }

    public InputType getInputType() {
        return inputType;
    }

    public void setInputType(InputType inputType) {
        this.inputType = inputType;
    }

    public FieldInputView(FieldFormConfig<InputFieldBean> config) {
        InputFieldBean inputFieldBean = config.getWidgetConfig();
        this.sourceMethodName = config.getSourceMethodName();
        this.entityClassName = config.getEntityClassName();
        this.sourceClassName = config.getSourceClassName();
        this.viewInstId = config.getViewInstId();
        this.domainId = config.getDomainId();
        this.inputType = inputFieldBean.getInputType();
        this.selectable = inputFieldBean.getSelectable();
        this.labelPos = inputFieldBean.getLabelPos();
        this.labelGap = inputFieldBean.getLabelGap();
        this.labelHAlign = inputFieldBean.getLabelHAlign();
        this.labelVAlign = inputFieldBean.getLabelVAlign();
        this.valueFormat = inputFieldBean.getValueFormat();
        this.value = inputFieldBean.getValue();
        this.hAlign = inputFieldBean.gethAlign();
        this.mask = inputFieldBean.getMask();
        this.tipsBinder = inputFieldBean.getTipsBinder();
        this.tipsOK = inputFieldBean.getTipsOK();
        this.tipsErr = inputFieldBean.getTipsErr();
        this.maxlength = inputFieldBean.getMaxlength();
        this.multiLines = inputFieldBean.getMultiLines();
        this.autoexpand = inputFieldBean.getAutoexpand();


    }

    public String getSourceMethodName() {
        return sourceMethodName;
    }

    public void setSourceMethodName(String sourceMethodName) {
        this.sourceMethodName = sourceMethodName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getTipsErr() {
        return tipsErr;
    }

    public void setTipsErr(String tipsErr) {
        this.tipsErr = tipsErr;
    }

    public String getTipsOK() {
        return tipsOK;
    }

    public void setTipsOK(String tipsOK) {
        this.tipsOK = tipsOK;
    }

    public String getTipsBinder() {
        return tipsBinder;
    }

    public void setTipsBinder(String tipsBinder) {
        this.tipsBinder = tipsBinder;
    }

    public String getMask() {
        return mask;
    }

    public void setMask(String mask) {
        this.mask = mask;
    }

    public String getViewInstId() {
        return viewInstId;
    }

    public void setViewInstId(String viewInstId) {
        this.viewInstId = viewInstId;
    }

    public String getDomainId() {
        return domainId;
    }

    public void setDomainId(String domainId) {
        this.domainId = domainId;
    }

    public Boolean getSelectable() {
        return selectable;
    }

    public void setSelectable(Boolean selectable) {
        this.selectable = selectable;
    }


    public LabelPos getLabelPos() {
        return labelPos;
    }

    public void setLabelPos(LabelPos labelPos) {
        this.labelPos = labelPos;
    }

    public String getLabelGap() {
        return labelGap;
    }

    public void setLabelGap(String labelGap) {
        this.labelGap = labelGap;
    }

    public HAlignType getLabelHAlign() {
        return labelHAlign;
    }

    public void setLabelHAlign(HAlignType labelHAlign) {
        this.labelHAlign = labelHAlign;
    }

    public VAlignType getLabelVAlign() {
        return labelVAlign;
    }

    public void setLabelVAlign(VAlignType labelVAlign) {
        this.labelVAlign = labelVAlign;
    }

    public String getValueFormat() {
        return valueFormat;
    }

    public void setValueFormat(String valueFormat) {
        this.valueFormat = valueFormat;
    }


    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public HAlignType gethAlign() {
        return hAlign;
    }

    public void sethAlign(HAlignType hAlign) {
        this.hAlign = hAlign;
    }


    public Integer getMaxlength() {
        return maxlength;
    }

    public void setMaxlength(Integer maxlength) {
        this.maxlength = maxlength;
    }

    public Boolean getMultiLines() {
        return multiLines;
    }

    public void setMultiLines(Boolean multiLines) {
        this.multiLines = multiLines;
    }

    public Integer getAutoexpand() {
        return autoexpand;
    }

    public void setAutoexpand(Integer autoexpand) {
        this.autoexpand = autoexpand;
    }


    public String getEntityClassName() {
        return entityClassName;
    }

    public void setEntityClassName(String entityClassName) {
        this.entityClassName = entityClassName;
    }

    public String getSourceClassName() {
        return sourceClassName;
    }

    public void setSourceClassName(String sourceClassName) {
        this.sourceClassName = sourceClassName;
    }
}
